package com.aspose.cells;

class zkp {
   static double a(Worksheet var0, double var1, WorksheetCollection var3) {
      switch(var0.getViewType()) {
      case 2:
         double var4 = var0.y()[0];
         var1 = (double)((int)(var1 / var4 + 0.5D));
      default:
         return a(var1, var3);
      }
   }

   static double a(double var0, WorksheetCollection var2) {
      int var3 = var2.I();
      int var4 = var2.H();
      int var5 = var2.J();
      if (var0 < (double)(var3 + var5)) {
         return 1.0D * var0 / (double)(var3 + var5);
      } else {
         double var6 = (double)((int)((double)((int)(var0 - (double)((int)((double)(var3 * var4) / 256.0D + 0.5D)))) * 100.0D / (double)var3 + 0.5D)) / 100.0D;
         if (var6 > 255.0D) {
            var6 = 255.0D;
         }

         return var6;
      }
   }

   static int a(double var0, Worksheet var2) {
      boolean var3 = var2.getViewType() == 2;
      double var4 = var3 ? var2.y()[0] : 1.0D;
      int var6 = b(var0, var2.c());
      return (int)((double)var6 * var4 + 0.5D);
   }

   static int b(double var0, WorksheetCollection var2) {
      int var3;
      if (var0 > 1.0D) {
         var3 = (int)(var0 * (double)var2.I() + 0.5D);
         int var4 = (int)((double)(var2.I() * var2.H()) / 256.0D + 0.5D);
         return var3 + var4;
      } else {
         var3 = (int)(var0 * (double)(var2.I() + (int)((double)(var2.I() * var2.H()) / 256.0D + 0.5D)) + 0.5D);
         return var3;
      }
   }
}
